#ifndef MAINSCENCE_H
#define MAINSCENCE_H
#include<QTimer>
#include <QWidget>
#include"map.h"
#include<QPainter>
#include<plantplane1.h>
#include<QMouseEvent>
#include "bullet1.h"
#include"commonzomb.h"
#include"bucketzomb.h"
#include "conezomb.h"
#include <ctime>
#include "bumb.h"
#include<QPushButton>
#include <QSoundEffect>

QT_BEGIN_NAMESPACE
namespace Ui {
class mainScence;
}
QT_END_NAMESPACE

class mainScence : public QWidget
{
    Q_OBJECT

public:
    mainScence(QWidget *parent = nullptr);
    ~mainScence();
    void initScene();
    void playGame();
    void updatePosition();
    void paintEvent(QPaintEvent *);
    void commonzomb_toscene();
    void bucketzomb_toscene();
    void conezome_toscene();
    void collisionDetetion();
    void end();
    void win();
    commonzomb m_commonzombs[COMMONZOMB_NUM];
    bucketzomb m_bucketzombs[BUCKETZOMB_NUM];
    conezomb m_conezombs[CONEZOMB_NUM];
    int m_recorder_com;
    int m_recorder_buc;
    int m_recorder_con;
    int m_recorder1;
    int m_recorder2;
    int m_recorder3;
    void speedup();
    map m_map;
    commonzomb m_COM;
    conezomb m_CON;
    bucketzomb m_BUC;
    bullet1 bullet;
    plantplane1 m_Plant;
    bullet1 m_bullet1;
    void mouseMoveEvent(QMouseEvent * event);
    int interval_now;
    //bullet1 temp;
     QSoundEffect backgroundeffect;
    QTimer m_Timer;

    bumb m_bombs[BOMB_NUM];

    QPixmap End;
    QPixmap Won;

    bool OVER;
    bool WON;
    QSoundEffect *player = new QSoundEffect;
private:
    Ui::mainScence *ui;
};
#endif // MAINSCENCE_H
